#!/bin/bash
rm includes/*
find -name '*.php' -exec grep -l 'include' {} \; > includes/includes.log
cd includes
cp includes.log others.tmp.0
grep    '[^\.]session.php' others.tmp.0     > session.log
grep -v '[^\.]session.php' others.tmp.0     > others.tmp.session
grep    '[^\.]connect.php' others.tmp.session > connect.log
grep -v '[^\.]connect.php' others.tmp.session > others.tmp.connect
grep    '[^\.]1.php' others.tmp.connect > 1.log
grep -v '[^\.]1.php' others.tmp.connect > others.tmp.1
grep    '[^\.]2.php' others.tmp.1     > 2.log
grep -v '[^\.]2.php' others.tmp.1     > others.tmp.2
grep    '[^\.]2alt.php' others.tmp.2  > 2alt.log
grep -v '[^\.]2alt.php' others.tmp.2  > others.tmp.2alt
grep    '[^\.]3.php' others.tmp.2alt  > 3.log
grep -v '[^\.]3.php' others.tmp.2alt  > others.tmp.3
grep    '[^\.]4.php' others.tmp.3     > 4.log
grep -v '[^\.]4.php' others.tmp.3     > others.tmp.4
grep    '[^\.]5.1.php' others.tmp.4   > 5.1.log
grep -v '[^\.]5.1.php' others.tmp.4   > others.tmp.5.1
grep    '[^\.]5.3.php' others.tmp.5.1 > 5.3.log
grep -v '[^\.]5.3.php' others.tmp.5.1 > others.tmp.5.3
grep    '[^\.]6.php' others.tmp.5.3   > 6.log
grep -v '[^\.]6.php' others.tmp.5.3   > others.tmp.6
grep    '[^\.]7.php' others.tmp.6     > 7.log
grep -v '[^\.]7.php' others.tmp.6     > others.tmp.7
grep    '[^\.]8.php' others.tmp.7     > 8.log
grep -v '[^\.]8.php' others.tmp.7     > others.tmp.8
cp others.tmp.8 others.log
rm others.tmp.*
